package com.qiwx.pigeon.adapter.manager;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.qiwx.pigeon.R;
import com.qiwx.pigeon.data.vo.WareHouseBean;

import java.util.List;

/**
 * @description
 * @Author qiwx
 * @Date 2020-03-24 16:15
 * 鸽仓管理 Adapter
 **/
public class WareHouseAdapter extends BaseQuickAdapter<WareHouseBean, BaseViewHolder> {


    public WareHouseAdapter(int layoutResId) {
        super(layoutResId);
    }

    public WareHouseAdapter(int layoutResId, List<WareHouseBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, WareHouseBean bean) {

        holder.setText(R.id.txt_number, bean.getNumber()+"");
        String statusDes;
        int status = bean.getStatus();
        statusDes = status == 1 ? "正在使用" : "未使用";
        holder.setText(R.id.txt_status, statusDes);

        //holder.setText(R.id.txt_number, bean.getNumber());
        String cages;
//        if (bean.() != null && bean.getCages().size() > 0) {
//            cages = "0个";
//        } else {
//            cages = bean.getCages().size() + "个";
//        }
        holder.setText(R.id.txt_cages, bean.getAmount()+"");

    }
}
